﻿using System;

namespace Confcloud.Email.Templates
{
	public class SubscribeUserEmail : EmailQueue<Confcloud.Email.Templates.SubscribeUserEmail>
	{
		public new const string TemplateName = "SubscribeUser";

		#region Parameters

		public const string UnsubscribeUrl = "UNSUBSCRIBEURL";

		#endregion

		private readonly string _email;
		private readonly string _unsubscribeUrl;


		public SubscribeUserEmail(string email, string unsubscribeUrl)
			: base(TemplateName)
		{
			_email = email;
			_unsubscribeUrl = unsubscribeUrl;
		}


		#region Overrides of RestObject<ParticipantActivationEmail>

		public override Confcloud.Email.Templates.SubscribeUserEmail Get()
		{
			throw new NotImplementedException();
		}

		public override Confcloud.Email.Templates.SubscribeUserEmail Post()
		{
			base.Recipent = string.Format("{0}", _email);
			AddParam(UnsubscribeUrl, _unsubscribeUrl);
			return base.Post();
		}

		public override Confcloud.Email.Templates.SubscribeUserEmail Put()
		{
			throw new NotImplementedException();
		}

		public override Confcloud.Email.Templates.SubscribeUserEmail Delete()
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}